package com.erps.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.erps.CommonUtils.StringEx;
import com.erps.config.res.HumanController;
import com.erps.sys.rest.ErspAchievementRest;
import com.erps.sys.rest.PageData;
import com.erps.sys.rest.PageInfo;
import com.jfinal.core.Controller;

/**
 * AchievementController
 */
public class AchievementController extends Controller {
	private static final Logger log = LoggerFactory.getLogger(HumanController.class);

	public void index() {
		int iPageSize = StringEx.getInt(this.getPara("_pagesize"), 20);
		int iPageNo = StringEx.getInt(this.getPara("_pageno"), 1);
		String cSort = StringEx.getStr(this.getPara("sort"));

		ErspAchievementRest vUser = new ErspAchievementRest();
		PageInfo vPage = new PageInfo();
		vPage.setPagesize(iPageSize);
		vPage.setSort(cSort);

		String cOrgID = "";
		PageData ret = vUser.Query(cOrgID, iPageNo, iPageSize, cSort);
		vPage.setRowcount(ret.getRowcount());

		vPage.setPageno(iPageNo);

		setAttr("res_list", ret.getKeylist());

		render("ersp_achievement.ftl");
	}
}
